<ui:component xmlns:ui="http://java.sun.com/jsf/facelets"
              xmlns:h="http://java.sun.com/jsf/html"
              xmlns:app="http://java.sun.com/jsf/composite/app"
              xmlns:ds="http://deltaset.org/deltaset-faces"
              xmlns:f="http://java.sun.com/jsf/core"
              xmlns:c="http://java.sun.com/jsp/jstl/core">


    <ds:titlebar title="#{locationMsg['view.title']}"/>


    <ds:fieldset rendered="#{not empty locationModel.id}">


        <ds:outputText label="#{locationMsg['locationName']}" value="#{locationModel.locationName}"/> 

    </ds:fieldset>

    <ds:fieldset rendered="#{empty locationModel.id}">

        Please select Location <br/>

    </ds:fieldset>


    <c:set target="#{viewScope}" property="locationPageHelperMTO" value="#{locationBean.all(param.page)}"/>
    <ds:pagedDataTable rendered="#{not empty locationTarget}"
                       title="All Locations"
                       pageHelper="#{viewScope.locationPageHelperMTO}"
                       pageParamName="page">
                       
            <h:column>
                <f:facet name="header">
                    <h:outputText value="#{locationMsg['locationName']}"/>
                </f:facet>
                <h:outputText value="#{item.locationName}"/>
            </h:column>
 

        <h:column>
            <h:commandButton styleClass="ds-button"
                             onmouseup="this.blur()"
                             immediate="true"
                             action="#{locationBean.setModelTo(item,locationTarget)}"
                             value="Select">
                <f:ajax execute="@form" render="@form"/>
            </h:commandButton>
        </h:column>
    </ds:pagedDataTable>

</ui:component>